package org.dromara.easyes.common.enums;

import lombok.Getter;

import java.util.stream.Stream;

/**
 * ProductName: easy-es
 * Package: org.dromara.easyes.common.enums
 * Description:
 * Author: 86631561@163.coom
 * Date: 2023/8/1 10:41
 * UpdateUser: 86631561@163.coom
 * UpdateDate: 2023/8/1 10:41
 * UpdateRemark: The modified content
 * Version: 1.0.0
 * <p>
 * Copyright © 2023 86631561@163.coom Technologies Inc. All Rights Reserved
 **/
@Getter
public enum ESIndexSuffixEnum {
    /** 全部查询 */
    ALL,
    /** 按天 */
    BY_DAY,
    /** 按月 */
    BY_MONTH,
    /** 按年 */
    BY_YEAR,
    ;
    public static ESIndexSuffixEnum fromValue(String val) {
        return Stream.of(ESIndexSuffixEnum.values())
                .filter(action -> action.name().equals(val))
                .findFirst()
                .orElse(null);
    }
}
